public class Main27 {
    //请定义一个交通工具（Vehicle）类，其中有属性：速度（speed）、体积（size）,方法：移动（move）、
    // 设置速度，加速speedUp(),减速speedDown（）
    // .最后在测试类中的main()中实例化，初始化speed,size，然后打印出来，并进行加速减速改变。
    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle(100,10);

        System.out.println(vehicle.toString());

        vehicle.speedDown(10);
        System.out.println(vehicle.toString());

        vehicle.speedUp(20);
        System.out.println(vehicle.toString());
    }
}

class Vehicle{
    double speed;
    double size;

    public Vehicle(double speed, double size) {
        this.speed = speed;
        this.size = size;
    }

    public void move(){
        System.out.println("移动");
    }

    public void speedUp(double speed) {
        this.speed += speed;
    }

    public void speedDown(double speed) {
        this.speed -= speed;
    }

    @Override
    public String toString() {
        return "Vehicle{" +
                "speed=" + speed +
                ", size=" + size +
                '}';
    }
}